package com.oocl.products.service.impl;

import java.util.List;

import com.oocl.products.dao.ProductDao;
import com.oocl.products.dao.impl.ProductDaoImpl;
import com.oocl.products.pojo.Product;
import com.oocl.products.service.ProductService;

public class ProductServiceImpl implements ProductService {
	private ProductDao productDao;

	public ProductServiceImpl() {
		productDao = new ProductDaoImpl();
	}
	
	public boolean addProduct(Product product) {
		if(productDao.addProduct(product)>0){
			return true;
		}
		return false;
	}

	public boolean deleteProduct(String pid) {
		if(productDao.deleteProduct(pid)>0){
			return true;
		}
		return false;
	}

	public boolean updateProduct(Product product) {
		if(productDao.updateProduct(product)>0){
			return true;
		}
		return false;
	}

	public Product queryProductByPid(String pid) {
		return productDao.queryProductByPid(pid);
	}

	public List<Product> queryAllProductBySid(Integer sid) {
		return productDao.queryAllProductBySid(sid);
	}

	

}
